home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef _ALPHABET_INLINES_H_
- #define _ALPHABET_INLINES_H_
-
- #if NSTRING_DEBUG > 0
- #include <stdio.h>
- #endif
-
- //________________________________________________________________________
-
- inline Alphabet::Alphabet (void)
- {
-
- #if (NSTRING_DEBUG & 1) != 0
- printf("Creating empty alphabet.\n");
- #endif
-
- clear();
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator+ (const char element) const
- {
- Alphabet result(*this); // copy this alphabet
-
- result += element;
- return result;
- }
-
- //________________________________________________________________________
-
- Alphabet Alphabet::operator- (const char element) const
- {
- Alphabet result(*this); // copy this alphabet
-
- result -= element;
- return result;
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator+ (const char *source) const
- {
- Alphabet result(*this); // copy this alphabet
-
- result += source;
- return result;
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator+ (const NString& source) const
- {
- Alphabet result(*this); // copy this alphabet
-
- result += source;
- return result;
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator- (const char *source) const
- {
- Alphabet result(*this); // copy this alphabet
-
- result -= source;
- return result;
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator+ (const Alphabet& other) const
- {
- Alphabet result(*this); // copy this alphabet
-
- result += other;
- return result;
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator* (const Alphabet& other) const
- {
- Alphabet result(*this); // copy this alphabet
-
- result *= other;
- return result;
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator- (const Alphabet& other) const
- {
- Alphabet result(*this); // copy this alphabet
-
- result -= other;
- return result;
- }
-
- //________________________________________________________________________
-
- inline Alphabet& Alphabet::operator*= (const char *string)
- {
- Alphabet other(string); // create an alphabet from the given string
-
- *this *= other;
- return *this;
- }
-
- //________________________________________________________________________
-
- inline Alphabet& Alphabet::operator*= (const NString& string)
- {
- Alphabet other(string); // create an alphabet from the given string
-
- *this *= other;
- return *this;
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator* (const char *string) const
- {
- Alphabet other(string); // create an alphabet from the given string
- Alphabet result(*this * other);
-
- return result;
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator* (const NString& string) const
- {
- Alphabet other(string); // create an alphabet from the given string
- Alphabet result(*this * other);
-
- return result;
- }
-
- //________________________________________________________________________
-
- inline Alphabet Alphabet::operator- (void) const
- {
- Alphabet result(*this); // copy this alphabet
-
- result.complement();
- return result;
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator== (const char *other) const
- {
- Alphabet a(other);
- return (*this == a);
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator== (const NString& other) const
- {
- Alphabet a(other);
- return (*this == a);
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator!= (const Alphabet& other) const
- {
- return (! (*this == other));
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator!= (const char *other) const
- {
- Alphabet a(other);
- return (! (*this == a));
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator!= (const NString& other) const
- {
- Alphabet a(other);
- return (! (*this == a));
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator<= (const Alphabet& other) const
- {
- return ((*this * other) == *this);
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator<= (const char *other) const
- {
- Alphabet a(other);
- return ((*this * a) == *this);
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator<= (const NString& other) const
- {
- Alphabet a(other);
- return ((*this * a) == *this);
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator< (const Alphabet& other) const
- {
- return ((*this != other) && (*this <= other));
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator< (const char *other) const
- {
- Alphabet a(other);
- return ((*this != a) && (*this <= a));
- }
-
- //________________________________________________________________________
-
- inline int Alphabet::operator< (const NString& other) const
- {
- Alphabet a(other);
- return ((*this != a) && (*this <= a));
- }
-
- #endif
-